Open a socket connected to an existing server .
UDPOpen ( IPAddr, port )
Parameters
IPAddr | Internet Protocol dotted address(IpV4) as "192.162.1.1". |
port | port on which the created socket will be connected. |
Return Value
Success: | Returns an array : $array[1] contains the real socket, $array[2] contains the specified IP address and $array[3] contains the port. We need this information in subsequent calls to UDPSend(), where we pass this socket structure/array. | |
Failure: | Returns -1 and set @error according to WSAGetLasterror Windows API return. |
Remarks
This function is used by a client to communicate with the server.
Related
UDPBind, UDPSend
Example
;CLIENT!!!!!!!! Start SERVER First... dummy!!
$g_IP = "127.0.0.1"
; Start The UDP Services
;==============================================
UDPStartUp()
; Connect to a Listening "SOCKET"
;==============================================
$socket = UDPOpen( $g_IP, 65432 )
If @error <> 0 Then Exit